In traditional networking environments, devices are typically configured statically. Since most devices join or leave the network infrequently, the configuration of devices is usually done manually or by invoking a script on the device. As mobile devices become more popular and networks become more dynamic, it is often impractical to statically configure policies for devices that may be roaming among different networks. For example, a laptop computer may be required to have one set of security policies when it is connected to a corporate local area network, a different set of security policies when connected to an ad hoc public wireless hot spot, and yet another set of security policies when connected to the home network. Furthermore, because devices may join and leave network environments at random, it has become more difficult to enforce network policies. It would be desirable if a device could be more aware of its environment and more easily configured when moving between environments with different policy requirements. It would also be useful if policy compliance could be more effectively enforced.